package com.android.bandroid.home.banner;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.android.bandroid.R;
import com.bigkoo.convenientbanner.CBPageAdapter;
import com.nostra13.universalimageloader.core.ImageLoader;

/**
 * 网络图片加载例子
 */
public class NetworkImageHolderView implements CBPageAdapter.Holder<String>{
    private ImageView imageView;
    @Override
    public View createView(Context context) {
        imageView = new ImageView(context);
        imageView.setScaleType(ImageView.ScaleType.FIT_XY);
        return imageView;
    }

    @Override
    public void UpdateUI(Context context,int position, String data) {
        imageView.setImageResource(R.mipmap.ic_launcher);
        ImageLoader.getInstance().displayImage(data,imageView);
    }
}
